/**
 * 
 */
package net.akcegaraz.tipleague.client.composite;

import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.ListBox;
import com.google.gwt.user.client.ui.TextBox;

/**
 * @author monckdav
 * 
 */
@Deprecated
public class MatchEventComposite extends Composite {
    private static final String OBLIGATORY = "*";

    private Label name;
    private Label homeTeamName;
    private Label awayTeamName;
    private ListBox tip;
    private TextBox score;
    private Label obligatory;
    private final HorizontalPanel horizontalPanel;

    public MatchEventComposite() {
	horizontalPanel = new HorizontalPanel();
	initWidget(horizontalPanel);
    }

    public MatchEventComposite(String name) {
	this();
	getName().setText(name);
    }

    public Label getAwayTeamName() {
	if (awayTeamName == null) {
	    awayTeamName = new Label();
	}
	return awayTeamName;
    }

    public Label getHomeTeamName() {
	if (homeTeamName == null) {
	    homeTeamName = new Label();
	}
	return homeTeamName;
    }

    public Label getName() {
	if (name == null) {
	    name = new Label();
	}
	return name;
    }

    public Label getObligatory() {
	if (obligatory == null) {
	    obligatory = new Label();
	}
	return obligatory;
    }

    public TextBox getScore() {
	if (score == null) {
	    score = new TextBox();
	}
	return score;
    }

    public ListBox getTip() {
	if (tip == null) {
	    tip = new ListBox();
	}
	return tip;
    }

    public void init() {
	horizontalPanel.add(getName());
	horizontalPanel.add(getObligatory());
	horizontalPanel.add(getHomeTeamName());
	horizontalPanel.add(getAwayTeamName());
	horizontalPanel.add(getTip());
	horizontalPanel.add(getScore());
    }

    public void setAwayTeamName(Label awayTeamName) {
	this.awayTeamName = awayTeamName;
    }

    public void setHomeTeamName(String homeTeamName) {
	this.homeTeamName.setText(homeTeamName);
    }

    public void setName(Label name) {
	this.name = name;
    }

    public void setObligatory(boolean obligatory) {
	if (obligatory) {
	    this.obligatory.setText(OBLIGATORY);
	}
    }

    public void setScore(TextBox score) {
	this.score = score;
    }

    public void setTip(ListBox tip) {
	this.tip = tip;
    }

}
